import 'package:get/get.dart';

import '../../status/xmm_load_status.dart';
import 'xmm_base_controller.dart';

class XmmStatusGetxController extends XmmBaseGetxController {
  ///加载状态  0加载中 1加载成功 2加载数据为空 3加载失败
  final loadState = XmmLoadStatus.loading.obs;

  showSuccess() {
    updateLoadState(XmmLoadStatus.success);
  }

  showFail() {
    updateLoadState(XmmLoadStatus.error);
  }

  showEmpty() {
    updateLoadState(XmmLoadStatus.empty);
  }

  showLoading() {
    updateLoadState(XmmLoadStatus.loading);
  }

  updateLoadState(XmmLoadStatus status) {
    loadState.value = status;
  }

}
